import { put } from './crud'
export function ctrlService(tid, serviceid, params) {
    let ctrlcmd = {
        identifier: serviceid,
        tid: tid,
        params: params,
    };
    return new Promise((re,rej)=>{

    put("api/service", ctrlcmd, "uid=" + tid)
        .catch((err) => {
            console.log(err);
            rej(err)
        }).then((res=>{
            if(res && res.data){
                if(res.data.result){
                    return re(res.data.result)
                }
            }
            re()
            
        }))
    })
}
export default {
    ctrlService,
}